﻿using System;
using System.Collections.Generic;
using System.Windows;
using Sonce.Editor.Data;

namespace Sonce.Editor
{
	public class LayerEventArgs : EventArgs
	{
		#region Properties
		/// <summary>
		/// Get the angle of the element. Origin is the top left corner.
		/// </summary>
		public double Angle
		{
			get;
			private set;
		}

		/// <summary>
		/// Get the location of the element. Origin is the top left corner.
		/// </summary>
		public Point Location
		{
			get;
			private set;
		}

		/// <summary>
		/// Get the element.
		/// </summary>
		/// <remarks>Alternative: public T Element = default(T);</remarks>
		public FrameworkElement Element
		{
			get;
			private set;
		}
		#endregion

		#region Constructors
		/// <summary>
		/// Initializes a new LayerEventArgs instance.
		/// </summary>
		public LayerEventArgs()
		{
		}

		/// <summary>
		/// Initializes a new LayerEventArgs instance.
		/// </summary>
		/// <param name="element"></param>
		public LayerEventArgs(FrameworkElement element)
			: this(element, new Point())
		{
			Point point = new Point();
			point.X = element.Margin.Left;
			point.Y = element.Margin.Top;
			this.Location = point;
		}

		/// <summary>
		/// Initializes a new LayerEventArgs instance.
		/// </summary>
		/// <param name="element"></param>
		/// <param name="location"></param>
		public LayerEventArgs(FrameworkElement element, Point location)
		{
			this.Element = element;
			this.Location = location;
		}
		#endregion
	}
}
